<?php
/**
 * Created by PhpStorm.
 * User: 小灰灰
 * Date: 2023-11-08
 * Time: 11:31:04
 * Info:
 */

namespace app\common\model;

class Keywords extends TimeInit
{

    // 关联关键字
    public function increase($keywords)
    {
        $is_exist = $this->where('title', $keywords)->find();
        if ($is_exist) {
            $res = $is_exist['id'];
        } else {
            $res = $this->strict(false)->field(true)->insertGetId(['title' => $keywords, 'create_time' => time()]);
        }

        return $res;
    }
}
